package pkg.deberes;

import javax.swing.*;
import java.awt.*;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
public class Ejercicio12 extends JFrame{
private JPanel panelSuperior=null;
private JPanel panelDerecho=null;
private JPanel panelIzquierdo=null;
private JPanel panelInferior=null;
	public Ejercicio12()
	{
		this.setTitle("Ejercicio12");
		this.setSize(500,300);
		panelSuperior = new JPanel(new FlowLayout(FlowLayout.LEFT));
		panelSuperior.setBackground(Color.cyan);
		panelSuperior.add(new JButton("Sup.1"));
		panelSuperior.add(new JButton("Sup.2"));
		panelSuperior.add(new JButton("Sup.3"));
		panelSuperior.add(new JButton("Sup.4"));
		
		panelInferior = new JPanel(new FlowLayout());
		panelInferior.setBackground(Color.yellow);
		panelInferior.add(new JLabel("Pon texto"));
		panelInferior.add(new JTextField(25));
		panelInferior.add(new JButton("Listo"));
		
		panelIzquierdo = new JPanel();
		panelIzquierdo.setLayout(new BoxLayout(panelIzquierdo, BoxLayout.Y_AXIS));
		panelIzquierdo.setBackground(Color.red);
		panelIzquierdo.add(new JButton("1"));
		panelIzquierdo.add(new JButton("2"));
		panelIzquierdo.add(new JButton("3"));
		
		panelDerecho = new JPanel();
		panelDerecho.setLayout(new BoxLayout(panelDerecho, BoxLayout.Y_AXIS));
		panelDerecho.setBackground(Color.green);
		panelDerecho.add(new JButton("A"));
		panelDerecho.add(new JButton("B"));
		panelDerecho.add(new JButton("C"));
		panelDerecho.add(new JButton("D"));
		
		this.getContentPane().add(panelSuperior, BorderLayout.NORTH);
		this.getContentPane().add(panelInferior, BorderLayout.SOUTH);
		this.getContentPane().add(panelDerecho, BorderLayout.EAST);
		this.getContentPane().add(panelIzquierdo, BorderLayout.WEST);
	}
	public class acabar extends WindowAdapter
	{
		public void closingWindow(WindowEvent e)
		{
			System.exit(0);
		}
	}
}
